Ensure compatibility with PHP < 5.3.9#2
Conversation
|
Yeah, please merge this PR or update the composer.json to require PHP >= 5.3.9. |
|
I had forgotten this PR until now, thanks @pableu for your attention. I agree it should be merged. I'm currently using my own branch of finediff in a project that runs on PHP 5.3.3, via composer's git capabilities, but that smells kinda hackish to me, considering there's only a single 4-line diff between it and yours. It would be nicer if I (or any other poor soul stuck with PHP 5.3.3) could just reference your package since it's already on packagist. I checked the output of the Travis builds and one of them seems to have failed due to a network error, hence the fail notice. I can assure you the corresponding PHPUnit tests passed successfully when I ran them on my environment. Regards. |
GranuarityInterface is the main interface of granularities. It should extend both \ArrayAccess and \Countable directly and shouln't define ArrayAccess methods like offsetExists() again. This kinda fixes cogpowered#2 even though the PHP 5.3 problem is not an issue here anymore.
GranuarityInterface is the main interface of granularities. It should extend both \ArrayAccess and \Countable directly and shouln't define ArrayAccess methods like offsetExists() again. This kinda fixes cogpowered#2 even though the PHP 5.3 problem is not an issue here anymore.
Prior to PHP 5.3.9 a class could not implement two interfaces if they contained a method with the same name (see first note at http://php.net/manual/en/language.oop5.interfaces.php).
The Granularity class implements both GranularityInterface and ArrayAccess and they both specify the set of offset* methods, so this results in a fatal error when running on PHP < 5.3.9 (I tested it on PHP 5.3.3). There's really no need to specify this methods in GranularityInterface, given that they're already defined in ArrayAccess.